<%@ page language="java" isELIgnored="false" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>

<head>
<title>详细信息</title>
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/js/show.js"></script>
<link href="<%=request.getContextPath()%>/fare/css/base.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=request.getContextPath()%>/fare/js/jquery-1.6.4.min.js"></script>
<link href="<%=request.getContextPath() %>/fare/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath() %>/fare/css/base.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/ligerui.min.js"></script>
<script src="<%=request.getContextPath() %>/fare/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
<!-- 圆角文本框 -->
<link href="<%=request.getContextPath() %>/fare/css/htc/htc.css" rel="stylesheet" type="text/css" />

    
     <script type="text/javascript">
     var columns=[ 
  	 			{  display : '序号',	width:  25, 
  	 				render: function(data, index) { return (this.options.page-1)*this.options.pageSize+index+1;}
  	 		    },
  	 		    {display : '航段',width : 180,name : 'leg'},
  	 			{display : '查看详情',width : 70,
  	 				render: function (record, rowindex, value, column) {
  	 					return "<a href=\"javaScript:open_HBase_detail(\'"+record.sourceRowkey+"\');\">查看详情</a>";
  	 				   }
  	 			},
  	 			{display : 'HBase key',width : 320,	name : 'sourceRowkey'},
  	 			{display : '流量大小(b)', width : 100,name : 'byteLength'}, 
  	 			{display : '源数据大小(b)', width : 100,name : 'sourceDataSize'}, 
  	 			{ display : '航班日期',width : 85,name : 'grabDate',format: 'yyyy-MM-dd'}, 
  	 			{display : '网站名称', width : 100,name : 'grabChannel'}, 
  	 			{display : '执行时长',width : 50,	name : 'wasteTime'},
  	 			{ display : '执行开始时间',width : 130,name : 'startTime',type: 'date',format: 'yyyy-MM-dd hh:mm:ss',
  	 				p:{showTime: true}	
  	 			},
  	 			{ display : '执行结束时间',width : 130,name : 'endTime',type: 'date',format: 'yyyy-MM-dd hh:mm:ss',
  	 				p:{showTime: true}	
  	 			},
  	 			{ display : '抓取日志',width : 310,	name : 'remarks'}
  	 			];
     
        $(function () {
        	var grabchannelID=GetQueryString("grabchannelID");
        	var grabdate=GetQueryString("grabdate");
        	var status=GetQueryString("status");
			var url="<%=request.getContextPath() %>/taskRecordAction!findFailDetailInfo.action?grabdate="+grabdate+"&grabchannelID="+grabchannelID
					+"&status="+status;
        	   $("#maingrid").ligerGrid({
        		    dataAction : 'server',
        		    title:'任务详细信息',
					showTitle:true,
					height:'100%',
				    columns : columns,
				    url:url,
			        width: '100%',
			        usePager:true,
					pageSize:30,
					pagesizeParmName:'pagesize'
        	 	});   
        });
        
        function GetQueryString(name)  
        {  
            var reg = new RegExp("(^|&)"+name+"=([^&]*)(&|$)");  
            var r= window.location.search.substr(1).match(reg);  
            if (r!=null) return unescape(r[2]);return null;  
        }        
        
        function open_HBase_detail(sourceRowKey){
        	if($.trim(sourceRowKey).length>0){
        		 $.ajax({
        			  url: "<%=request.getContextPath() %>/taskRecordAction!fetchContent.action?sourceRowKey="+$.trim(sourceRowKey),
        			  cache: false,
        			  success: function(data){
        				  //var OpenWindow=window.showModalDialog("test.html?data="+data, data, "dialogWidth=200px;dialogHeight=100px"); 
        				  //var OpenWindow=window.showModalDialog("http://www.bejson.com/go.html?u=http://www.bejson.com/jsonview2/","JSON详情", "  width=4000,toolbar=yes,scrollbars=yes,menubar=yes",false);
        				  var OpenWindow=window.open("test.html", "HBase详情", "height=1000,width=4000,toolbar=yes,scrollbars=yes,menubar=yes",false); 
        				  OpenWindow.document.write(data) ;
        			  } 
        			});
        	}else{
        		 $.ligerDialog.warn('HBase的sourceRowKey为空');
        	}
        }
        
        function mergecell(gridid, columnid) //参数:表格id和列索引关键字，根据表格具体值来动态合并单元格
        {
            var i, j, k, x;
            i = -1; k = 1; j = ""; x = 0;
            var cellname = "";

            $("td[id$='|" + columnid + "']", gridid).each(
                   function() {
                       if (j == $("div", this).text()) {
                           $(this).addClass("l-remove");
                           k++;
                           $("td[id='" + cellname + "']", gridid).attr("rowspan", k.toString());
                       }
                       else {
                           j = $("div", this).text();
                           var a = $(this);
                           cellname = a.attr("id"); //得到点击处的id                            
                           k = 1;
                           x = i;
                       }
                       i++;
                   });
            $(".l-remove").remove();
        }
    </script>      
    <script >
	function reload(){
		window.location.reload();
	}
	
	function closewin(){
		if (confirm("您确定要关闭本页吗？")){
			var urls="fswInfoAction!getStatisticsTaskReport.action";
			window.location.href=urls;
			}
			else{}

	}
	function returnF(){
		var urls="fswInfoAction!getStatisticsTaskReport.action";
		window.location.href=urls;
	}
	</script>          
</head>

<body style="padding:10px">

	<form>
	<input name="fromCity" id="fromCity" type="hidden" value="${fromCity}"/>
	
	</form>
	
		<div id="reseachBy" >
		<table width="100%" cellpadding="0" cellspacing="5">
			<tr>
				<td align="left" width="95%">
					抓取渠道:&nbsp;&nbsp;
					<% String grabchannel=request.getParameter("grabchannel"); %>
					<%=new String(grabchannel.getBytes("ISO-8859-1"),"UTF-8")%>
					
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					 航班抓取日期:&nbsp;&nbsp;<%=request.getParameter("grabdate")%>
				
				</td>
				<td align="left">
					<!-- <input type="button" onclick="reload()" value="刷新"/> -->
					<!-- <input type="button" onclick="closewin()"  value="关闭"/>
					<input type="button" onclick="returnF()"  value="返回首页"/> -->
				
				</td>
			</tr>
		</table>
		</div>

    <div id="maingrid" style="margin-top: 0px">
    </div>
    <div id="results" style="margin-top: 20px">
    </div>
</body>
</html>
